package com.jerry.alibaba.transaction.service.impl;

import com.jerry.alibaba.transaction.dao.StorageDao;
import com.jerry.alibaba.transaction.entity.Storage;
import com.jerry.alibaba.transaction.service.StorageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StorageServiceImpl implements StorageService {

    @Resource
    private StorageDao storageDao;

    @Override
    public void decrease(Long productId, Integer count) {
        storageDao.decrease(productId, count);
    }

    @Override
    public int create(Storage storage) {
        return storageDao.create(storage);
    }

    @Override
    public Storage getById(Long id) {
        return storageDao.getById(id);
    }

    @Override
    public List<Storage> getList() {
        return storageDao.getList();
    }
}
